<?php
session_start();
include "session.php";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="html/text; charset=utf-8" />
<title>子模块添加</title>
</head>
<body>
<?php
  include "mysql.php";
  include "myfunction.php";
  $aa=new mysql;
  $aa->link("");
  $bb=new myfunction;
  $tijiao=$_POST["tijiao"];
  if($tijiao=="提交"){
      $farther_module_id=$_POST["farther_module_id"];
      $module_name=$_POST["module_name"];
      $module_cont=$_POST["module_cont"];
       $user_name=$_POST["user_name"];
      if($farther_module_id=="" and $module_name=="" and  $module_cont=="" and $user_name==""){
          echo "<script language=javascript>alert('必须选择隶属的父模块，模块简介和模块名称不能为空,请重新填写');</script>";
      }else{
          $query="insert into son_module_info (farther_id,module_name,module_cont) values('$farther_module_id','$module_name','$module_cont')";
          if($aa->excu($query)){
              echo "<script language=javascript>alert('子模块添加成功');</script>";
          }
      }
  }
  ?>
  <br> <br> <br> <br> <br> <br> <br>
    <table width="30%" border="0" align="center" cellspacing="0"  cellpadding="0" >
        <tr>
            <td height="20" align="center" ><b>欢迎您添加子模块</b> </td>
        </tr>
    </table>
 <form action="#" method="post">
<table width="40%" border="1" align="center" cellspacing="0"  cellpadding="0" >
<tr>
 <td height="15" align="right" width="30%">隶属的父模块:</td>
 
 <td height="15" align="left" width="70%"></td>
</tr>
<tr>
 <td height="15" align="right" width="30%">子模块名称</td>
 <td height="15" align="left" width="70%"><input type="text" name="module_name"></td>
</tr>
<tr>
 <td height="35" align="right" width="30%">简介</td>
 <td height="35" align="left" width="70%"><textarea name="module_cont" cols="50" rows="8"></textarea></td>
</tr>
<tr>
 <td height="15" align="right" width="30%">版主</td>
 <td height="15" align="left" width="70%"><input type="text" name="user_name">可不填..</td>
</tr>
<tr>
    <td height="15" align="center" colspan="2">
        <input type="submit" name="tijiao" value="提交">&nbsp;&nbsp;
        <input type="submit" name="tijiao" value="重置">
   </td>
</tr>
</table>
 </form>
</body>
</html>